package com.battery.system.mapper;

import com.battery.system.base.BaseMapper;
import com.battery.system.domain.*;
import com.battery.system.domain.BO.MerchantBO;
import com.battery.system.domain.VO.MerchantExcelVO;
import com.battery.system.domain.VO.MerchantVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 商户Mapper接口
 *
 * @author battery
 * @date 2021-01-22
 */
public interface MerchantMapper extends BaseMapper<Merchant> {
    /**
     * 查询商户
     *
     * @param id 商户ID
     * @return 商户
     */
    public Merchant selectMerchantById(String id);

    /**
     * 查询商户列表
     *
     * @param merchant 商户
     * @return 商户集合
     */
    public List<Merchant> selectMerchantList(Merchant merchant);

    /**
     * 新增商户
     *
     * @param merchant 商户
     * @return 结果
     */
    public int insertMerchant(Merchant merchant);

    /**
     * 修改商户
     *
     * @param merchant 商户
     * @return 结果
     */
    public int updateMerchant(Merchant merchant);

    /**
     * 删除商户
     *
     * @param id 商户ID
     * @return 结果
     */
    public int deleteMerchantById(String id);

    /**
     * 批量删除商户
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    public int deleteMerchantByIds(String[] ids);

    /**
     * @param merchantBO
     * @return
     */
    List<MerchantVO> selectMerchantVOList(@Param("merchantBO") MerchantBO merchantBO);

    MerchantVO selectMerchantByphone(String phone);

    MerchantStatistics selectMerchantStatistics(@Param("id") String id);

    List<MerchantStoreList> selectMerchantStoreList(@Param("id") String id);

    MerchantIncome selectMerchantByIncome(@Param("map") Map<String, String> map);

    List<MerchantIncomeList> selectMerchantIncomeList(@Param("map") Map<String, String> map);

    /**
     * 导出商户-门店信息
     *
     * @param merchantBO
     * @return
     */
    List<MerchantExcelVO> selectMerchantExcelVOList(@Param("merchantBO") MerchantBO merchantBO);


    MerchantIncome selectBorrowData(@Param("map") Map<String, String> map);
}
